package com.bcqn.service.impl;

import com.bcqn.dao.ForumTypeMapper;
import com.bcqn.model.ForumType;
import com.bcqn.service.ForumTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ForumTypeServiceImpl
 *
 * @author Kelly
 * @version v1.0
 * @date 2020/4/19 21:00
 */
@Service
public class ForumTypeServiceImpl implements ForumTypeService {

    @Autowired
    private ForumTypeMapper forumTypeMapper;

    @Override
    public int add(ForumType forumType) {
        return forumTypeMapper.insertSelective(forumType);
    }

    @Override
    public int update(ForumType forumType) {
        return forumTypeMapper.updateByPrimaryKeySelective(forumType);
    }

    @Override
    public int delete(Long id, Long userId) {
        // userId 日志
        return forumTypeMapper.deleteByPrimaryKey(id);
    }
}
